<template>
	
	<view class="content">
		<u-navbar title="成为合伙人"  :autoBack="true">
		</u-navbar>
		<view class="info">

			<view class="c1">推荐人姓名</view>
			<view class="c2">
				<u--input v-model='form.realname' placeholder="请输入" :customStyle="{padding: '0 32rpx'}">
				</u--input>
			</view>

			<view class="c1">推荐人帐号（手机号码）：</view>
			<view class="c2">
				<u--input v-model='form.partner_account' placeholder="请输入" :customStyle="{padding: '0 32rpx'}">
				</u--input>
			</view>

		</view>

		<view class="but">
			<view class="s2" @click="onSend()">
				<text>提 交</text>
			</view>
		</view>
		<view style="padding:0 60rpx;font-size:34rpx;color: #ACACAC;text-align:justify;margin-top:100rpx">
			梦想是我们人生的追求，申请成为超田批发合伙人后，会有更多惊喜和权益给到您！超田伴成长欢迎您的加入，余生相伴并肩同行，风雨同舟共享彩虹！
		</view>

	</view>
</template>

<script>
	import {
		apply_api
	} from '@/api/second.js'
	import conf from '@/common/config.js';
	export default {

		data() {
			return {
				isMobile: '',
				tips: '',
				gender_show: false,
				birthday_show: false,
				columns: [
					['未知', '男', '女']
				],
				birthday_time: Number(new Date()),
				maxDate: Number(new Date()),
				birthday_date: '',
				mobile: '',
				avatar: '',
				qrcode: '',
				form: {
					realname: '',
					partner_account: ''
				}
			};
		},
		onLoad({
			realname,
			account
		}) {
			if (realname || account) {
				if (this.vuex_token == '') {
					uni.setStorageSync('shareInfo', {
						realname,
						account
					})
					uni.redirectTo({
						url: '/pages/my/login'
					})
					return false;
				}
				this.form.realname = realname
				this.form.partner_account = account
			}
		},
		methods: {
			onSend() {
				if (!this.form.realname) return this.$u.toast('请输入邀约人姓名')
				if (!this.form.partner_account) return this.$u.toast('请输入邀约人账号')
				apply_api(this.form).then((res) => {
					console.log(res);
					if (1 == res.code) {
						this.$u.toast(res.msg)
						setTimeout(function() {
							uni.navigateTo({
								url: '/pages/my/index' // 这里是你要跳转的页面路径
							});
						}, 500);
					}
				})


			}
		}
	}
</script>

<style lang="scss">
	.c3 {
		margin-top: 40rpx;
	}

	.tips {
		font-size: 28rpx;
		color: #7677EB;
	}

	.content {
		width: 670rpx;
		margin: 0 auto;
	}

	.info {
		width: 566rpx;
		padding: 52rpx;
		margin: 52rpx auto;
		background-color: #fff;
		border-radius: 48rpx;
		@include flex(column);

		.avatar {
			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}
		}

		.c1 {
			height: 28rpx;
			font-size: 28rpx;
			font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
			font-weight: 400;
			color: #7D8592;
			line-height: 28rpx;
			margin-top: 56rpx;
		}

		.c2 {
			width: 566rpx;
			margin-top: 40rpx;
			position: relative;

			/deep/ .u-input {
				height: 98rpx;
				border-radius: 28rpx;
			}

			.on_in {
				position: absolute;
				inset: 0;
			}
		}

		.qrcode {
			@include flex;
			justify-content: space-between;
			align-items: center;

			image {
				width: 128rpx;
				height: 128rpx;
				margin-top: 24rpx;
			}
		}

	}

	.but {
		@include flex;
		margin-top: 60rpx;
		margin-bottom: 60rpx;

		.s2 {
			width: 290rpx;
			height: 96rpx;
			background: #7677EB;
			box-shadow: 0 12rpx 24rpx 0 rgba(63, 140, 255, 0.2637);
			border-radius: 28rpx;
			margin: 0 auto;
			text-align: center;

			text {
				font-size: 30rpx;
				font-family: Alibaba PuHuiTi 2.0, Alibaba PuHuiTi 20;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 96rpx;
			}
		}
	}
</style>